package com.ruoyi.web.controller.loan.controller;

import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.loan.dto.SelectReturnLoanListDto;
import com.ruoyi.loan.service.LoanRecordService;
import com.ruoyi.loan.service.ReturnLoanService;
import com.ruoyi.loan.vo.SelectReturnLoanListPage;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Author lin
 * @Date 2022/4/11 18:26
 */
@Controller
@RequestMapping("loan/return")
public class ReturnLoanRecordController {

    @Resource
    private LoanRecordService recordService;

    @Resource
    private ReturnLoanService returnLoanService;

    @GetMapping()
    public String message(){
        String prefix = "loan/return";
        return prefix + "/return";
    }

//    @ResponseBody
//    @ApiOperation("查询学生还款信息")
//    @GetMapping("/returnLoanList")
//    public AjaxResult selectReturnLoanList(SelectReturnLoanListDto dto){
//        SelectReturnLoanListPage pageInfo = recordService.selectReturnLoanList(dto);
//        return AjaxResult.success(pageInfo);
//    }

    @ResponseBody
    @GetMapping("/returnLoanList")
    public AjaxResult getReturnLoanList(SelectReturnLoanListDto dto){
        PageInfo returnLoanList = returnLoanService.getReturnLoanList(dto);
        return AjaxResult.success(returnLoanList);
    }

}
